BigDFT.Interop.BabelInterop module

This module contains some wrappers for using OpenBabel to perform various operations on BigDFT molecules.

https://open-babel.readthedocs.io/en/latest/UseTheLibrary/Python.html

convert_system_to_babel(sys)[source]

Convert a BigDFT system to an open babel molecule.

Parameters

sys (BigDFT.Systems.System) – the system to convert.

Returns

an open babel type molecule.

Return type

(openbabel.OBMol)

convert_babel_to_system(mol)[source]

Convert a BigDFT fragment to an open babel molecule.

Parameters

mol (openbabel.OBMol) – the molecule to convert.

Returns

bigdft system.

Return type

(BigDFT.Systems.System)

compute_smiles(sys)[source]

Computes the SMILES representation of a given system.

Parameters

sys (BigDFT.System.Systems) – the system to compute the representation of.

Returns

the smiles representation of this molecule.

Return type

(str)

compute_fingerprint(sys, fps='fp2')[source]

Computes the fingerprint for a particular fragment.

Parameters
  • sys (BigDFT.Systems.System) – the fragment to compute the representation of.

  • fps (str) – the type of finger print to compute.

Returns

a fingerprint for this fragment.

Return type

(openbabel.OBFingerprint)

system_energy(sys, forcefield='MMFF94', verbose=False)[source]

Compute the energy of a system using an openbabel forcefield.

Parameters
  • sys (BigDFT.Systems.System) – the system to compute.

  • forcefield (str) – the type of forcefield to use.

  • verbose (bool) – whether to have openbabel run in verbose mode.

Returns

the energy value computed in Hartree.

Return type

(float)

optimize_system(sys, forcefield='MMFF94', method='SteepestDescent', steps=1000, econv=1e-06, verbose=False)[source]

Optimize the geometry of a given fragment.

Parameters
  • sys (BigDFT.Systems.System) – the fragment to optimize.

  • forcefield (str) – the type of forcefield to use.

  • verbose (bool) – if True, the openbabel output will be printed.

Returns

a new fragment with the optimized positions.

Return type

(BigDFT.Fragments.Fragment)

molecular_dynamics(sys, steps, temperature, forcefield='MMFF94', timestep=0.001, verbose=False)[source]

Run molecular dynamics on a given fragment..

Parameters
  • sys (BigDFT.Systemtems.System) – the system to run.

  • steps (int) – the number of MD steps to take.

  • temperature (float) – temperature in K.

  • timestep (float) – time step in picoseconds.

  • forcefield (str) – the type of forcefield to use.

  • constraints (list) – for each atom, list whether it if frozen or not.

  • verbose (bool) – if True, the openbabel output will be printed.

Returns

a new system with the optimized positions.

Return type

(BigDFT.Systems.System)

compute_system_forces(sys, forcefield='MMFF94', verbose=False)[source]

Assign the forces of a system using an openbabel forcefield.

Parameters
  • sys (BigDFT.Systems.System) – the system to compute.

  • forcefield (str) – the type of forcefield to use.

  • verbose (bool) – whether to have openbabel run in verbose mode.

Returns

the energy of the system.

Return type

(float)